<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>静态网页托管平台</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        .drop-zone {
            border: 2px dashed #cbd5e1;
            transition: all 0.3s ease;
        }
        .drop-zone.dragover {
            border-color: #3b82f6;
            background-color: #eff6ff;
        }
        .file-item {
            transition: all 0.3s ease;
        }
        .file-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }
    </style>
</head>
<body class="bg-gray-50 min-h-screen">
    <div class="container mx-auto px-4 py-8">
        <header class="text-center mb-8">
            <h1 class="text-4xl font-bold text-gray-800 mb-2">
                <i class="fas fa-cloud-upload-alt text-blue-500"></i>
                静态网页托管平台
            </h1>
            <p class="text-gray-600">拖拽上传，即刻托管，一键分享</p>
        </header>

        <div class="max-w-4xl mx-auto">
            <!-- 上传区域 -->
            <div class="bg-white rounded-lg shadow-lg p-6 mb-6">
                <div id="dropZone" class="drop-zone rounded-lg p-8 text-center cursor-pointer">
                    <i class="fas fa-cloud-upload-alt text-4xl text-gray-400 mb-4"></i>
                    <p class="text-lg font-semibold text-gray-700 mb-2">拖拽文件到此处或点击选择</p>
                    <p class="text-sm text-gray-500">支持 HTML、CSS、JS、图片等静态资源</p>
                    <input type="file" id="fileInput" multiple webkitdirectory directory class="hidden">
                </div>

                <!-- 自定义域名 -->
                <div class="mt-4">
                    <label class="block text-sm font-medium text-gray-700 mb-2">
                        自定义子域名（可选）
                    </label>
                    <input type="text" id="customDomain" placeholder="my-site" 
                           class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
                    <p class="text-xs text-gray-500 mt-1">留空将生成随机短链接</p>
                </div>

                <!-- 上传进度 -->
                <div id="uploadProgress" class="hidden mt-4">
                    <div class="bg-gray-200 rounded-full h-2">
                        <div id="progressBar" class="bg-blue-500 h-2 rounded-full" style="width: 0%"></div>
                    </div>
                    <p id="progressText" class="text-sm text-gray-600 mt-2">准备上传...</p>
                </div>

                <!-- 上传按钮 -->
                <button id="uploadBtn" class="w-full mt-4 bg-blue-500 text-white py-2 px-4 rounded-md hover:bg-blue-600 transition duration-300 hidden">
                    <i class="fas fa-upload mr-2"></i>开始上传
                </button>
            </div>

            <!-- 文件列表 -->
            <div id="fileList" class="bg-white rounded-lg shadow-lg p-6 mb-6 hidden">
                <h3 class="text-lg font-semibold mb-4">已选择文件</h3>
                <div id="filesContainer" class="space-y-2"></div>
            </div>

            <!-- 结果展示 -->
            <div id="result" class="bg-white rounded-lg shadow-lg p-6 hidden">
                <h3 class="text-lg font-semibold mb-4">上传成功！</h3>
                <div class="bg-green-50 border border-green-200 rounded-md p-4">
                    <p class="text-sm text-green-800 mb-2">您的网站已托管成功：</p>
                    <div class="flex items-center space-x-2">
                        <input type="text" id="siteUrl" readonly 
                               class="flex-1 px-3 py-2 border border-gray-300 rounded-md bg-gray-50">
                        <button id="copyBtn" class="bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600">
                            <i class="fas fa-copy"></i>
                        </button>
                    </div>
                </div>
            </div>

            <!-- 站点列表 -->
            <div id="sitesList" class="bg-white rounded-lg shadow-lg p-6">
                <h3 class="text-lg font-semibold mb-4">已托管站点</h3>
                <div id="sitesContainer" class="space-y-2">
                    <p class="text-gray-500 text-center">暂无托管站点</p>
                </div>
            </div>
        </div>
    </div>

    <script src="app.js"></script>
</body>
</html>
